package com.example.shop_2304.minefg

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.LinearLayoutManager
import com.blankj.utilcode.util.ToastUtils
import com.example.base.mvvm.BaseFragment
import com.example.shop_2304.R
import com.example.shop_2304.adapter.OrderAdapter
import com.example.shop_2304.adapter.OrderRoomAdapter
import com.example.shop_2304.databinding.FragmentPay2Binding
import com.example.shop_2304.databinding.FragmentPay4Binding
import com.example.shop_2304.room.AppDbUtils


class Pay4Fragment  : BaseFragment<FragmentPay4Binding, PayViewModel>() {
    lateinit var orderAdapter: OrderRoomAdapter
    override fun initView() {
        orderAdapter = OrderRoomAdapter()
        binding.rv.adapter = orderAdapter
        binding.rv.layoutManager = LinearLayoutManager(context)

        val query = AppDbUtils.getDb().getOrderDao().query("待评价")
        orderAdapter.data.clear()
        orderAdapter.data.addAll(query)
        orderAdapter.notifyDataSetChanged()
    }

    override fun initData() {

    }

    override fun getLayout(): Int = R.layout.fragment_pay4

    override fun getViewModel(): Class<PayViewModel>  = PayViewModel::class.java

}